﻿using System.Web;
using System.Web.UI;
using System.Web.UI.Adapters;

namespace Ue.Qcdz.Domain.UrlRewriter
{
    /// <summary>
    /// 解决PostBack之后目标地址并非客户端请求的地址ControlAdapter
    /// 在Web项目中创建一个browser文件，例如“App_Browsers\Form.browser” 并配置定义
    /// <browsers>
    ///   <browser refID="Default">
    ///     <controlAdapters>
    ///       <adapter controlType="System.Web.UI.HtmlControls.HtmlForm"
    ///           adapterType="Lswweb.Domain.FormRewriterControlAdapter" />
    ///     </controlAdapters>
    ///   </browser>
    /// </browsers>
    /// </summary>
    public class FormRewriterControlAdapter : ControlAdapter
    {
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(new RewriteFormHtmlTextWriter(writer));
        }
    }
}
